using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using eShop.Business;
using eShop.Business;

public partial class contactus : SitePublicBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        uccResponseMessage.Visible = false;
        
    }
    private void GenerateSEOData()
    {
        SEOHelper.RenderMetaTag(this.Page, "robots", "ALL", true);
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            Page.Validate();
            if (Page.IsValid)
            {
                Inquires inquery = new Inquires();
                inquery.Name = tbxName.Text;
                inquery.Organization = tbxOrganization.Text;
                inquery.EmailAddress = tbxEmail.Text;
                inquery.Telephone = tbxTelephone.Text;
                inquery.Website = tbxWebsiteAddress.Text;
                inquery.Subject = tbxSubjectOfInquiry.Text;
                inquery.Inquiry = tbxInquiry.Text;
                inquery.CreateDate = DateTime.Now;
                inquery.IsContacted = false;
                inquery.Create();
                new Email().SendInqueryEmailToAdmin(inquery);
                uccResponseMessage.SetSuccessMessage(ApplicationMessage.InquirySentMessage);
                uccResponseMessage.Visible = true;
            }
        }
        catch (Exception ex)
        {
            uccResponseMessage.SetFailMessage(ApplicationMessage.CommonFailure);
            uccResponseMessage.Visible = true;
        }
    }
}
